package servlet.user;

import entity.Pet;
import entity.User;
import service.CommentService;
import service.Impl.CommentServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import entity.Comment;
import service.Impl.PetServiceImpl;
import service.PetService;

@WebServlet("/user/comment")
public class UserCommentServlet extends HttpServlet {
    private CommentService commentService = new CommentServiceImpl();
    private PetService petService = new PetServiceImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("UTF-8");
        req.setAttribute("petList", petService.findAll());
        req.setAttribute("commentList", commentService.findAll());
        req.getRequestDispatcher("/user/comment.jsp").forward(req, resp);
    }


}
